package com.niit.TopOne.pctopone;

import com.niit.bean.PcTopOneBean;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

public class PcGroupingComparator extends WritableComparator {
    protected PcGroupingComparator() {
        super(PcTopOneBean.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        PcTopOneBean aBean = (PcTopOneBean) a;
        PcTopOneBean bBean = (PcTopOneBean) b;
        return aBean.getcity().compareTo(bBean.getcity());
    }
}